from .setting_get_set import read_config, write_config
from template.singleton import Singleton


class Class_configs(Singleton):
    def __init__(self) -> None:
        # self.__settings("config.json", "settings.json", "language.json")
        self.path = "/home/arksm/Рабочий стол/МОИ ПРОЕКТЫ/программирование/Core_voice_help_2_0/src/database/config_json/"
        self.path_config = f"{self.path}config.json"
        self.path_settings = f"{self.path}settings.json"
        self.path_langnuage = f"{self.path}langnuage.json"
        # self.path_tags = f"{self.path}tags.json"
        self.path_numbers = f"{self.path}numbers.json"
        self.__set_config()
        self.__set_settings()
        self.__set_language()
        # self.__set_tags()
        self.__set_numbers()
        print(2222)

    def __set_config(self):
        self.__config = read_config(self.path_config)

    def __set_settings(self):
        self.__settings = read_config(self.path_settings)

    def __set_language(self):
        self.__language = read_config(self.path_langnuage)

    # def __set_tags(self):
    #    self.__tags = read_config(self.path_tags)

    def __set_numbers(self):
        self.__numbers = read_config(self.path_numbers)

    def get_config(self):
        return self.__config

    def get_settings(self):
        return self.__settings

    def get_language(self):
        return self.__language

    # def get_tags(self):
    #    return self.__tags

    def get_numbers(self):
        return self.__numbers

    """
    def __del__(self):
        write_config(self.get_config(),self.path_config)
        write_config(self.get_settings(),self.path_settings)
        write_config(self.get_language(),self.path_langnuage)
        write_config(self.get_tags(),self.path_tags)
        write_config(self.get_numbers(),self.path_numbers)
    """


__all__ = ["Configs_Singleton"]
